package com.vegetable.modules.entity.outbound;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 销售订货
 * </p>
 *
 * @author wangruijie
 * @since 2024-03-27
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="AllocationOrder对象", description="调拨订货")
public class AllocationOrder implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("主键id")
    @JsonSerialize(using = ToStringSerializer.class)
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "生产者ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long producerId;

    @ApiModelProperty(value = "状态0已入库 1未入库")
    private Integer inStatus;

    @ApiModelProperty(value = "状态0已出库 1未出库")
    private Integer outStatus;


    @ApiModelProperty(value = "文档编号")
    private String docNo;

    @ApiModelProperty(value = "数量")
    private Integer number;

    @ApiModelProperty(value = "重量")
    private BigDecimal weight;

    @ApiModelProperty(value = "描述")
    private String remark;

    @ApiModelProperty(value = "创建者ID")
    private Long createUserId;

    @ApiModelProperty(value = "创建人")
    @TableField(exist = false)
    private String createUserName;

    @ApiModelProperty(value = "创建时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd")
    private Date createTime;

    @ApiModelProperty(value = "商品明细")
    @TableField(exist = false)
    private List<AllocationOrderDetail> commodities;

    @ApiModelProperty(value = "调入仓库名称")
    private String inWarehouseName;

    @ApiModelProperty(value = "调出仓库名称")
    private String outWarehouseName;

}
